﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FilStartUps.FILAPI;
using System.Configuration;
using System.Data;
using System.Web.Security;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace FilStartUps.Controls
{
    public partial class FilStartUps_CategoryPost : System.Web.UI.UserControl
    {
        private void GetCategoryPost(int catidFK)
        {
            try
            {
                var catpost = FilStartUpsAPI.GetCategoryPost(catidFK);
                lbposttitle.Text = catpost.posttitle;
                ltpostdescription.Text = catpost.postdescription;
                lbpostid.Text = catpost.postidPK.ToString();
                Session.Clear();
                Session["postid"] = lbpostid.Text;
            }
            catch (Exception)
            {

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int catid_ = Convert.ToInt32(Request.QueryString["c"].Trim());
                GetCategoryPost(catid_);
            }
        }
    }
}